package com.ybg.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ybg.utils.IdUtil;

/**
 * 学校相关
 * 1、【官网】开通申请dao类
 * @author	jade
 * @since	2017年3月31日
 */
@Repository
public class SchoolApply extends AbstractDao{
	@Autowired
	private IdUtil idUtil;
	
	
	/**
	 * 保存【官网】开通申请的信息到数据库
	 * @param schoolName
	 * @param userName
	 * @param userId
	 * @param mobile
	 * @param qq
	 * @param applyReason
	 * @param email
	 * @param apartment
	 * @return
	 */
	public boolean officialWebsiteApply(String schoolId, String schoolName, String userName, String userId, String mobile, String qq, String applyReason, String email, String department){
		StringBuilder sql = new StringBuilder();
		sql.append("INSERT INTO school_apply (id, schoolId, schoolName, userId, userName, mobile, qq, applyReason, email, department)");
		sql.append(" VALUES(?,?,?,?,?,?,?,?,?,?) ");
		int update = jdbcTemplate.update(sql.toString(),idUtil.nextVal("school_apply"),schoolId,schoolName,userId,userName,mobile,qq,applyReason,email,department);
		return update==1?true:false;
	}

}
